<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title></title>
    <link rel="stylesheet" href="../../../component/pear/css/pear.css" />
</head>
<body>
<div class="layui-card">
    <div class="layui-card-header" style="text-align: center;"><h1 id="title"></h1></div>
    <div class="layui-card-body" id="description"></div>
</div>

<div id="createInfo" style="text-align: right; padding-right: 50px;">
</div>
<script src="../../../component/layui/layui.js"></script>
<script src="../../../component/pear/pear.js"></script>
<script>
    layui.use(['descriptions', 'jquery'], function() {
        let desc = layui.descriptions;
        let $ = layui.jquery;
        let url = layui.url();
        let id = url.search.id;

        $.get('/vtl-announcement/detail/' + id, function(result) {
            let releasedContent = result.released == 1 ? '已发布' : '未发布';
            $('#title').text(result.title + '（' + releasedContent + '）');
            $('#description').html(result.description);

            let createInfo = '';
            if(result.released == 1) {
                createInfo = '<h4>发布者：' + $.vtl.blankToDefault(result.updateByName, '') + '&emsp;&emsp;&emsp;发布时间：' + result.updateTime + '</h4>';
            } else {
                createInfo = '<h4>更新者：' + $.vtl.blankToDefault(result.updateByName, '') + '&emsp;&emsp;&emsp;更新时间：' + result.updateTime + '</h4>';
            }
            $('#createInfo').html(createInfo);
        })
    })
</script>
</body>
</html>
